# utils/exceptions.py
class BaseException(Exception):
    """基础异常类"""
    def __init__(self, message, code=500):
        self.message = message
        self.code = code
        super().__init__(self.message)

class UserNotFoundException(BaseException):
    """用户不存在异常"""
    def __init__(self, message="用户不存在"):
        super().__init__(message, 1001)

class PasswordIncorrectException(BaseException):
    """密码错误异常"""
    def __init__(self, message="密码错误"):
        super().__init__(message, 1002)

class UserDisabledException(BaseException):
    """用户被禁用异常"""
    def __init__(self, message="用户已被禁用"):
        super().__init__(message, 1003)

class DatabaseConnectionError(BaseException):
    """数据库连接异常"""
    def __init__(self, message="数据库连接失败"):
        super().__init__(message, 1004)
